import 'package:flutter/material.dart';

// img 

void main() {
  runApp(MyApp());
}

// app
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Img')),
        body: HomeContent33(),
      ),
    );
  }
}

// 本地图片
class HomeContent33 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        child: Image.asset(
          "images/1.jpg",
          // alignment: Alignment.bottomRight,
          // color: Colors.blue,
          // colorBlendMode: BlendMode.screen,
          // fit: BoxFit.cover
          // repeat: ImageRepeat.repeatX,
        ),
        width: 300.0,
        height: 300.0,
        decoration: BoxDecoration(
          color: Colors.yellow
        ),
      ),
    );
  }
}

class HomeContent03 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        child: ClipOval(
          child: Image.network(
            'https://i1.hdslb.com/bfs/face/0cd621a535d99cc5eed5bd9243355c21d64a0e39.jpg@96w_96h_1c.webp',
            width: 300.0,
            height: 300.0,
            fit: BoxFit.cover
          ),
        ),
      ),
    );
  }
}

class HomeContent02 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        width: 300.0,
        height: 300.0,
        decoration: BoxDecoration(
          color: Colors.yellow,
          // borderRadius: BorderRadius.all(
          //   Radius.circular(150)
          // )
          borderRadius: BorderRadius.circular(150),
          image: DecorationImage(
            image: NetworkImage(
              'https://i1.hdslb.com/bfs/face/0cd621a535d99cc5eed5bd9243355c21d64a0e39.jpg@96w_96h_1c.webp'
            ),
            fit: BoxFit.cover
          )
        ),
      ),
    );
  }
}

// 远程图片
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        child: Image.network(
          "https://i1.hdslb.com/bfs/face/0cd621a535d99cc5eed5bd9243355c21d64a0e39.jpg@96w_96h_1c.webp",
          alignment: Alignment.bottomRight,
          // color: Colors.blue,
          // colorBlendMode: BlendMode.screen,
          // fit: BoxFit.cover
          // repeat: ImageRepeat.repeatX,
        ),
        width: 300.0,
        height: 300.0,
        decoration: BoxDecoration(
          color: Colors.yellow
        ),
      ),
    );
  }
}
